package uk.co.revisual.creation
{
	public class FactoryError extends Error
	{
		public static const EMPTY_FACTORY:int = 0;
		public static const CLASSES_NOT_DECLARED:int = 1;
		
		private static const MESSAGES:Array = [	"There are no classes declared in this factory",
												"These classes are not declared in this factory: "	];
		
		
		
		public var items:Array;
		public var id:int;
		
		public function FactoryError( id:int=0, items:Array = null )
		{
			this.items = items;
			this.id = 5100 + id;
			super( MESSAGES[ id ], this.id);
		}
		
		public function toString():String{
			var msg:String = message;
			if( items != null) msg + ":: " + items.toString() ;
			return msg;
		}
		
		
	}
}